#ifndef __MAIN_WIDGET_H__
#define __MAIN_WIDGET_H__ 1

#include <QtGui>
#include <QWidget>
#include <QVBoxLayout>
#include <QTabWidget>

#include "client_connection.h"
#include "connection_widget.h"
#include "tab_conf.h"
#include "tab_comm.h"
#include "tab_defense.h"
#include "tab_logging.h"

class QAction;
class QWidgetButtonBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QMenu;
class QMenuBar;
class QPushButton;
class QTextEdit;

/**
 * @brief this is the actual view for the stegit-2 control
 * @author rpoisel
 */

class CMainWidget : public QWidget
{
	 Q_OBJECT

public:
	 CMainWidget(CPropertiesModel* pConfModel,
			 QWidget* pParent = 0);
	 virtual ~CMainWidget();

	 CConnectionWidget* getConnectionWidget();

	void clientConnected(QString& pHost, quint16& pPort);
	void clientDisconnected();
	void connectionError();

	void startRequested();
	void configRequested();
	void sendConfigRequested(CClientConnection* pConnection);
	void infoReceived(ELogLevel& pLogLevel, QString& pInfoMsg);
	void loadFromFile(const QString& pFilename);
	void saveToFile(const QString& pFilename);

	inline CTabComm* getTabComm() { return &mTabComm; }
	inline CTabConf* getTabConf() { return &mTabConf; }
	inline CTabDefense* getTabDefense() { return &mTabDefense; }
	inline CTabLogging* getTabLogging() { return &mTabLogging; }

private:
	void setupUiElements();
	void setupActions();

	 QVBoxLayout mCentralLayout;
	 QTabWidget mTabWidget;
	 CTabConf mTabConf;
	 CTabComm mTabComm;
	 CTabDefense mTabDefense;
	 CTabLogging mTabLogging;
	 CConnectionWidget mConnectionWidget;
};

#endif /* __MAIN_WIDGET_H__ */

